USE [master]
GO

IF (DB_ID(N'Example.Repository') IS NOT NULL)
	BEGIN
	DROP DATABASE [Example.Repository]
	END
GO

IF (DB_ID(N'Example.Repository') IS NULL)
	BEGIN
	CREATE DATABASE [Example.Repository] COLLATE SQL_Latin1_General_CP1_CI_AI
	END
GO

IF (FULLTEXTSERVICEPROPERTY('IsFullTextInstalled') = 1)
	BEGIN
	EXEC [Example.Repository].[dbo].[sp_fulltext_database] @action = 'enable'
	END
GO

IF (DATABASEPROPERTYEX(N'Example.Repository','Status') <> N'ONLINE')
	BEGIN
	RAISERROR(N'The state of the target database, %s, is not set to ONLINE. To deploy to this database, its state must be set to ONLINE.', 16, 127, N'Example.Repository') WITH NOWAIT
	RETURN
	END
GO

ALTER DATABASE [Example.Repository] SET ANSI_NULL_DEFAULT ON
GO
ALTER DATABASE [Example.Repository] SET ANSI_NULLS ON
GO
ALTER DATABASE [Example.Repository] SET ANSI_PADDING ON
GO
ALTER DATABASE [Example.Repository] SET ANSI_WARNINGS ON
GO
ALTER DATABASE [Example.Repository] SET ARITHABORT ON
GO
ALTER DATABASE [Example.Repository] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [Example.Repository] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [Example.Repository] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [Example.Repository] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [Example.Repository] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [Example.Repository] SET CURSOR_DEFAULT  LOCAL
GO
ALTER DATABASE [Example.Repository] SET CONCAT_NULL_YIELDS_NULL ON
GO
ALTER DATABASE [Example.Repository] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [Example.Repository] SET QUOTED_IDENTIFIER ON
GO
ALTER DATABASE [Example.Repository] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [Example.Repository] SET  ENABLE_BROKER
GO
ALTER DATABASE [Example.Repository] SET AUTO_UPDATE_STATISTICS_ASYNC ON
GO
ALTER DATABASE [Example.Repository] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [Example.Repository] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [Example.Repository] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [Example.Repository] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [Example.Repository] SET  READ_WRITE
GO
ALTER DATABASE [Example.Repository] SET RECOVERY FULL
GO
ALTER DATABASE [Example.Repository] SET  MULTI_USER
GO
ALTER DATABASE [Example.Repository] SET PAGE_VERIFY NONE
GO
ALTER DATABASE [Example.Repository] SET DB_CHAINING OFF
GO